-- <action itemid="2245" event="script" value="twigs.lua"/>
--- Twigs maked by Kronos aka Hellboy ---
function onUse(cid, item, fromPosition, itemEx, toPosition)

	local leftHand = getPlayerSlotItem(cid, 5)
	local rightHand = getPlayerSlotItem(cid, 6)
	
	if leftHand.itemid == rightHand.itemid then
		if item.uid == leftHand.uid then
			doRemoveItem(rightHand.uid)
		elseif item.uid == rightHand.uid then
			doRemoveItem(leftHand.uid)
		else
			return false
		end
		doTransformItem(item.uid, 1989)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		return true
	end
	return false
end

